package com.rockcent.mall.lib.repository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by oyhk on 16/7/29.
 *
 *
 * 中间表 需要自己实现,暂时不想使用hibernate 映射关联插入
 */
@Component
public class MallCertifyConfigsRepository {

    @Autowired
    private NamedParameterJdbcTemplate jdbcTemplate;


    public void save(Long mallId, String certifyConfig) {
        Map<String, Object> params = new HashMap<>();
        params.put("mallId", mallId);
        params.put("certifyConfig", certifyConfig);
        jdbcTemplate.update("insert into mall_certify_configs (mall_id,certify_configs) values(:mallId,:certifyConfig)", params);
    }
}
